using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using QLKS.DataLayer.BusinessObjects;
using QLKS.DataLayer.Base;

namespace QLKS.DataLayer.ManagerObjects
{
    public partial interface ICTPhieuThuePhongManager : IManagerBase<CTPhieuThuePhong, int>
    {
		// Get Methods
		IList<CTPhieuThuePhong> GetByMaKhachHang(System.Int32 khachHang);
		IList<CTPhieuThuePhong> GetByMaPhieuThue(System.String phieuThuePhong);
		IList<CTPhieuThuePhong> GetByTinhTrangID(System.Int32 tinhTrang);
    }

    partial class CTPhieuThuePhongManager : ManagerBase<CTPhieuThuePhong, int>, ICTPhieuThuePhongManager
    {
		#region Constructors
		
		public CTPhieuThuePhongManager() : base()
        {
        }
        public CTPhieuThuePhongManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<CTPhieuThuePhong> GetByMaKhachHang(System.Int32 khachHang)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(CTPhieuThuePhong));
			
			
			ICriteria khachHangCriteria = criteria.CreateCriteria("KhachHang");
            khachHangCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", khachHang));
			
			return criteria.List<CTPhieuThuePhong>();
        }
		
		public IList<CTPhieuThuePhong> GetByMaPhieuThue(System.String phieuThuePhong)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(CTPhieuThuePhong));
			
			
			ICriteria phieuThuePhongCriteria = criteria.CreateCriteria("PhieuThuePhong");
            phieuThuePhongCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", phieuThuePhong));
			
			return criteria.List<CTPhieuThuePhong>();
        }
		
		public IList<CTPhieuThuePhong> GetByTinhTrangID(System.Int32 tinhTrang)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(CTPhieuThuePhong));
			
			
			ICriteria tinhTrangCriteria = criteria.CreateCriteria("TinhTrang");
            tinhTrangCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", tinhTrang));
			
			return criteria.List<CTPhieuThuePhong>();
        }
		
		#endregion
    }
}